﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using Rison.DataAccess.Data.ZJCP;

namespace Rison.Web.ZJCP.ashx
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class DeleteIllustrativecase : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string departmentId = context.Request.Params["departmentId"];
            string ilId = context.Request.Params["ilId"];
            if (String.IsNullOrEmpty(departmentId) || String.IsNullOrEmpty(ilId))
            {
                context.Response.Write("<script>alert('参数不足！');history.back();</script>");
                return;
            }
            deleteIllustrativecase(ilId);
            context.Response.Redirect(String.Format("../IllustrativecaseList.aspx?departmentId={0}", departmentId));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        private Boolean deleteIllustrativecase(string qaId)
        {
            string sql = String.Format("delete from Illustrativecase where il_id='{0}'", qaId);
            return DbAccess.executeUpdate(sql) == 1;

        }
    }
}
